package com.defines.ming.demo.service.impl;

import com.defines.ming.demo.dao.ExpenseDao;
import com.defines.ming.demo.model.ExpenseHeader;
import com.defines.ming.demo.model.ExpenseLine;
import com.defines.ming.demo.service.ExpenseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExpenseServiceImpl implements ExpenseService {
    @Autowired
    ExpenseDao expenseDao;
    @Override
    public void insertExpenseHeader(ExpenseHeader header) {
        expenseDao.insertExpenseHeader(header);
    }

    @Override
    public void insertExpenseLine(ExpenseLine expenseLine) {
        expenseDao.insertExpenseLine(expenseLine);
    }

    @Override
    public List<ExpenseHeader> getMyPendingList(String employeeCode) {
        List<ExpenseHeader> list=expenseDao.getMyPendingList(employeeCode);
        return list;
    }

    @Override
    public void commitExpense(String expenseNum,String status,String approveNode) {
         expenseDao.commitExpense(expenseNum,status,approveNode);
    }

    @Override
    public List<ExpenseHeader> getExpenseInstance(String expenseNum) {
        List<ExpenseHeader> list=expenseDao.getExpenseInstance(expenseNum);
        return  list;
    }
}
